export default {
	data() {
		return {
			legendList: [
				// { count: 0, text: '0人', bgColor: '#c5c8ce' },
				{ count: 1, text: '1人', bgColor: '#19be6b' },
				{ count: 2, text: '2人', bgColor: '#2d8cf0' },
				{ count: 3, text: '3人', bgColor: '#ff9900' },
				{ count: 4, text: '4人及以上', bgColor: '#ed4014' }
			]
		};
	},
	methods: {
		setBgColor(item) {
			let countVal = 0;
			if (!item.scheduleEmpCount) {
				countVal = 0;
			} else if (item.scheduleEmpCount > 3) {
				countVal = 4;
			} else {
				countVal = item.scheduleEmpCount;
			}
			const legendItem = this.legendList.find(x => x.count === countVal) || {};
			return {
				color: '#fff',
				background: legendItem.bgColor
			};
		}
	}
};
